//
//  UIButton+DSTag.m
//  DemoTest
//
//  Created by DaShuEdu on 2017/5/11.
//  Copyright © 2017年 DaShuEdu. All rights reserved.
//

#import "UIButton+DSTag.h"

@implementation UIButton (DSTag)

- (void)zhuanti:(NSString *)zhuanti remen:(NSString *)remen liuxue:(NSString *)liuxue
{
    [self.titleLabel setFont:[UIFont systemFontOfSize:12]];
    if (zhuanti.length >= 1) {
        self.layer.borderColor = [UIColor redColor].CGColor;
        self.layer.borderWidth = 1.f;
        [self setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
        [self setTitle:zhuanti forState:UIControlStateNormal];
        self.userInteractionEnabled = YES;
        return;
    }
    self.userInteractionEnabled = NO;
    self.layer.borderColor = [UIColor clearColor].CGColor;
    self.layer.borderWidth = 0.0f;
    [self setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    
    if (remen.length >= 1) {
        [self setTitle:[NSString stringWithFormat:@"#%@#",remen] forState:UIControlStateNormal];
    } else {
        [self setTitle:[NSString stringWithFormat:@"#%@#",liuxue] forState:UIControlStateNormal];
    }
    
}

@end
